#####################################################
#                                                   #
#               Make file for gtandthetaeFIT        #
#                                                   #
#                         cgiocoli@gmail.com        #
#####################################################

# executable name
PROG = $(HOME)/bin/gtandthetaeFIT3b
PROG2 = $(HOME)/bin/generalgtandthetaeFIT3b

MAIN = main.cpp

# .cpp lib internal in MOKA
SOURCES = ../Moka/cosmology.cpp \
	  ../Moka/halo.cpp \
          ../Moka/nfwHalo.cpp \
          ../Moka/nfwLens.cpp \
          ../Moka/generalnfwHalo.cpp \
          ../Moka/generalnfwLens.cpp \
	  ../Moka/distributions.cpp \
	  ../Moka/utilities.cpp


# gsl, cfitsio, CCfits, fftw
LIBS = -L/Users/cgiocoli/lib/gsl-1.13/lib/ -lgslcblas -lgsl \
       -L/Users/cgiocoli/lib/cfitsio/lib/ \
       -L/Users/cgiocoli/lib/CCfits/lib/ -lCCfits -lcfitsio \
       -L/Users/cgiocoli/lib/fftw-3.2.2/lib/ -lfftw3 -lm 

# gsl, cfitsio, CCfits, fftw  -Wall
ALLFLAGS = -I/Users/cgiocoli/lib/gsl-1.13/include/gsl \
	   -I/Users/cgiocoli/lib/gsl-1.13/include \
           -I/Users/cgiocoli/lib/cfitsio/include/ \
           -I/Users/cgiocoli/lib/CCfits/include/ \
           -I/Users/cgiocoli/lib/fftw-3.2.2/include/ \
	   -I/$(HOME)/lib/Numerical/
# 
RELEASE = -O2 
# 
DEBUG = -g
# compiler  
CC = g++
#
RM = rm -f -r
#
OBJ = $(SOURCES:.cpp=.o)
#

CFLAGS=$(ALLFLAGS) $(DEBUG)
#
CLEAR = clear

default: wlsl
wlsl: 
	$(CC) -c $(SOURCES) $(CFLAGS)
	ar r libmokas.a *.o
	$(CC) $(MAIN) -L. -lmokas $(CFLAGS) -o $(PROG) $(LIBS) 

general: 
	$(CC) generalmain.cpp -L. -lmokas $(CFLAGS) -o $(PROG2) $(LIBS) 

main2: 
	$(CC) main2.cpp -L. -lmokas $(CFLAGS) -o $(HOME)/bin/gtandthetaeFIT3GLAMER $(LIBS) 

main: 
	$(CC) $(MAIN) -L. -lmokas $(CFLAGS) -o $(PROG) $(LIBS) 

clean:
	$(RM) $(PROG) *.o

lib:
	$(CC) -c $(SOURCES) $(CFLAGS)
	ar r libmokas.a *.o

clall:
	$(RM) $(PROG) $(PROG2) *.o libmokas.a *~


new: clean default
